﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using stwh_Common.DBUtility;//Please add references

namespace stwh_DAL
{
    public partial class stwh_menu_role_functionDAL : BaseDAL
    {
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public stwh_Model.stwh_menu_role_function DataRowToModel(DataRow row)
        {
            stwh_Model.stwh_menu_role_function model = new stwh_Model.stwh_menu_role_function();
            if (row != null)
            {
                if (row["stwh_fid"] != null)
                {
                    model.stwh_fid = int.Parse(row["stwh_fid"].ToString());
                }
                if (row["stwh_rid"] != null)
                {
                    model.stwh_rid = int.Parse(row["stwh_rid"].ToString());
                }
            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select stwh_fid,stwh_rid ");
            strSql.Append(" FROM stwh_menu_role_function ");
            if (strWhere.Trim() != "") strSql.Append(" where " + strWhere);
            return DbHelperSQL.Query(strSql.ToString());
        }
    }
}
